//
//  CityGroupModel.m
//  Shengzhuli
//
//  Created by 卡忙科技 on 16/8/4.
//  Copyright © 2016年 kamangkeji. All rights reserved.
//

#import "CityGroupModel.h"
#import "CityModel.h"

@implementation CityGroupModel

- (CityGroupModel *)initWithDict:(NSDictionary *)dict
{
    if (self = [super init]) {
        self.firstLeter = dict[@"firstLeter"];
        NSMutableArray *cities = [NSMutableArray array];
        for (NSDictionary *info in dict[@"cities"]) {
            CityModel *model = [CityModel cityWithDict:info];
            [cities addObject:model];
        }
        self.cities = cities;
    }
    return self;
}

+ (instancetype)cityGroupWithDict:(NSDictionary *)dict
{
    return [[CityGroupModel alloc]initWithDict:dict];
}

@end
